package com.woniu.dao;

import com.woniu.pojo.Friends;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface FriendsMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Friends record);

    int insertSelective(Friends record);

    Friends selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Friends record);

    int updateByPrimaryKey(Friends record);
@Delete("delete from friends where user_id=#{userId} and friends_id=#{friendId}")
    void deleteFriend(@Param("friendId") Long friendId,@Param("userId") Long userId);
    @Select("select * from friends where user_id=#{userId} and friends_id=#{friendId}")
    Friends selectFriend(Long friendId, Long userId);
@Select("select friends_id from friends where user_id=#{userId}")
    List<Long> selectFriendsId(Long userId);
}